function map_init(city)
{
    var map = new BMap.Map("map_container");
    map.centerAndZoom(city,12); 
    map.addControl(new BMap.NavigationControl({anchor: BMAP_ANCHOR_TOP_LEFT, type: BMAP_NAVIGATION_CONTROL_SMALL})); 
    map.enableDragging();

    //拖动后事件
    map.addEventListener("dragend", function showInfo(){
        var cp = map.getCenter();
        //alert(cp.lng + "," + cp.lat);

        $.ajax({
            url: "/api/activity/getNearby",
            type: "GET",
            dataType: "json",
            data: "lat="+cp.lat+"&lng="+cp.lng,
            success: function(data){
                console.log(data);
            }
        });
    });
    
    return map;
}

